<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // 求任意两个数之间的整数和  1~100之间的整数和    2~20 之间的整数和
        function getSum(start, end) {
            var sum = 0;
            for (var i = start; i <= end; i++) {
                sum += i;
            }
            console.log(sum);
        }
        getSum(1, 100);
        getSum(1, 10);
        getSum(2, 20);
    </script>
</head>

<body>

</body>

</html>